/* ==============================================
   1. 基础样式与通用动画
   ============================================== */
* {
    box-sizing: border-box;
}

.transition-all {
    transition: all 0.25s ease-in-out;
}

/* ==============================================
   2. 表格样式优化
   ============================================== */
.score-high {
    background-color: rgba(40, 167, 69, 0.05);
}
.score-medium {
    background-color: rgba(255, 193, 7, 0.05);
}
.score-low {
    background-color: rgba(220, 53, 69, 0.05);
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.03);
    transform: translateX(2px);
}

@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* ==============================================
   3. 统计卡片样式 (增强版)
   ============================================== */
.stats-card {
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    height: 100%;
}
.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}
.stats-card .card-body {
    position: relative;
    z-index: 1;
    padding: 1.5rem 1rem;
}
.stats-card .card-title {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}
.stats-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}
.stats-card small {
    font-size: 0.8rem;
    opacity: 0.8;
}
.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, rgba(13,110,253,0.8), rgba(13,110,253,0.2));
    opacity: 0;
    transition: opacity 0.3s ease;
}
.stats-card:hover::before {
    opacity: 1;
}

/* ==============================================
   4. 科目统计卡片样式 (新增)
   ============================================== */
.subject-stat-card {
    border: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    transition: all 0.3s ease;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}
.subject-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.subject-badge {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-item {
    background: rgba(248, 249, 250, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}
.stat-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.stat-item .stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}
.stat-item .stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
}

.mastery-progress {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}
.mastery-progress .progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

.mastery-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
    border-radius: 15px;
    font-weight: 600;
}

/* 掌握程度颜色系统 */
.bg-success {
    background: linear-gradient(45deg, #28a745, #20c997) !important;
}
.bg-info {
    background: linear-gradient(45deg, #17a2b8, #6f42c1) !important;
}
.bg-warning {
    background: linear-gradient(45deg, #ffc107, #fd7e14) !important;
}
.bg-danger {
    background: linear-gradient(45deg, #dc3545, #e83e8c) !important;
}

.text-success { color: #28a745 !important; }
.text-info { color: #17a2b8 !important; }
.text-warning { color: #ffc107 !important; }
.text-danger { color: #dc3545 !important; }

/* ==============================================
   5. 筛选卡片样式
   ============================================== */
.filter-card {
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}
.filter-card .card-title {
    color: #343a40;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}
.filter-card .card-title i {
    margin-right: 8px;
    color: #0d6efd;
}
.filter-card .form-control,
.filter-card .form-select {
    border-radius: 6px;
    border-color: #e2e8f0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.filter-card .form-control:focus,
.filter-card .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    outline: none;
}

/* ==============================================
   6. 操作按钮组样式
   ============================================== */
.btn-action-group .btn {
    margin-right: 5px;
    transition: all 0.2s ease;
    border-radius: 6px;
}
.btn-action-group .btn:last-child {
    margin-right: 0;
}
.btn-action-group .btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ==============================================
   7. 无数据提示样式
   ============================================== */
.no-record-alert {
    padding: 2.5rem;
    margin-bottom: 0;
    border-radius: 10px;
    background-color: rgba(13, 110, 253, 0.04);
    border-color: rgba(13, 110, 253, 0.1);
    text-align: center;
}
.no-record-alert i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #0d6efd;
}

/* ==============================================
   8. 分页控件样式
   ============================================== */
.pagination-container {
    margin-top: 1.5rem;
}
.pagination .page-item {
    margin: 0 2px;
}
.pagination .page-link {
    color: #0d6efd;
    border-radius: 6px;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
}
.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    font-weight: 500;
}
.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
}
.pagination .page-link:hover {
    color: #0a58ca;
    background-color: #eef2ff;
    border-color: #dbeafe;
    transform: translateY(-1px);
}

/* ==============================================
   9. 模态框样式
   ============================================== */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}
.modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.5rem;
}
.modal-title {
    font-weight: 600;
    color: #1e293b;
}
.modal-body {
    padding: 1.5rem;
}
.modal-footer {
    border-top: 1px solid #f1f5f9;
    padding: 1rem 1.5rem;
}

#viewDetailModal .card {
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    transition: transform 0.2s ease;
}
#viewDetailModal .card:hover {
    transform: translateY(-2px);
}
#viewDetailModal .card-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
#viewDetailModal .card-text strong {
    color: #1e293b;
}
#viewDetailModal .text-primary {
    color: #0d6efd !important;
    font-weight: 600;
}
#viewDetailModal .text-danger {
    color: #dc3545 !important;
    font-weight: 600;
}

#exportModal .modal-dialog {
    max-width: 350px;
}
#exportModal .modal-body {
    padding: 1.5rem;
}
#exportModal .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ==============================================
   10. 响应式设计增强
   ============================================== */
@media (max-width: 768px) {
    .stats-card h3 {
        font-size: 1.5rem;
    }
    
    .stats-card .card-body {
        padding: 1rem 0.75rem;
    }
    
    .subject-stat-card {
        margin-bottom: 1rem;
    }
    
    .stat-item .stat-value {
        font-size: 1.2rem;
    }
    
    .btn-action-group .btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .row > .col-md-3 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .subject-stat-card .row.text-center .col-4 {
        margin-bottom: 0.5rem;
    }
    
    .stat-item {
        padding: 0.75rem 0.5rem !important;
    }
    
    .stat-item .stat-value {
        font-size: 1.1rem;
    }
}

/* ==============================================
   11. 动画效果
   ============================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subject-stat-card {
    animation: fadeInUp 0.5s ease-out;
}

.stats-card {
    animation: fadeInUp 0.4s ease-out;
}

/* 延迟动画，让卡片依次出现 */
.subject-stat-card:nth-child(1) { animation-delay: 0.1s; }
.subject-stat-card:nth-child(2) { animation-delay: 0.2s; }
.subject-stat-card:nth-child(3) { animation-delay: 0.3s; }
.subject-stat-card:nth-child(4) { animation-delay: 0.4s; }
.subject-stat-card:nth-child(5) { animation-delay: 0.5s; }
.subject-stat-card:nth-child(6) { animation-delay: 0.6s; }

/* 空科目卡片样式 */
.empty-subject-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6 !important;
}

.empty-subject-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.empty-subject-content {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.empty-subject-card:hover .empty-subject-content {
    opacity: 1;
}